package com.bwei.like.mynewstop.base;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.ArrayList;

/**
 * Created by LiKe on 2016/11/3.
 */
public abstract class MyBaseAdapater<T> extends BaseAdapter{

    public Context context;
    public ArrayList<T> arrayList;

    public MyBaseAdapater(ArrayList<T> arrayList, Context context) {
        this.arrayList = arrayList;
        this.context = context;
    }

    @Override
    public int getCount() {
        return arrayList.size();
    }

    @Override
    public Object getItem(int position) {
        return arrayList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        return initView(position,convertView,parent);
    }

    public abstract View initView(int position, View convertView, ViewGroup parent);
}
